<?php

namespace App\Console\Commands\Invoice;

use App\Library\FeiShu\SendFs;
use App\Models\Invoice\InvoiceHistoryModel;
use App\Service\Invoice\InvoiceService;
use Illuminate\Console\Command;
use Kuafu\GeneralFs\BuildFs;

class InvoiceSyncHeaderCommand extends Command
{

    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'invoice:syncHeader {shopId=0}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '同步门店发票抬头';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    public function handle()
    {
        $shopId = $this->argument('shopId');
        list($status,$msg) = InvoiceService::syncInvoiceHeader($shopId,0);
        $this->info('同步完成: shopId:'.$shopId.'，结果：'.$status.", msg: ".$msg);
    }


}
